refactor: migrate building blocks to meshstack_building_block#215
Conversation
Scorecard Check
📊 meshstack-hub Module Scorecard
📋 Per-Module Category SummaryScore per category per building block.
Core Structure — some checks failingBasic module file structure and documentation — applies to 11 modules
Core Structure — Summary
Integration — some checks failingmeshstack_integration.tf conventions — applies to 10 modules
Integration — Summary
Azure Backplane — some checks failingAzure UAMI-based automation principal conventions — applies to 4 modules
Azure Backplane — Summary
STACKIT Backplane — some checks failingSTACKIT WIF-based automation principal conventions — applies to 2 modules
STACKIT Backplane — Summary
Testing — some checks failingEnd-to-end test coverage — applies to 11 modules
Testing — Summary
📈 Overall SummaryOverall Average Score: 88%Score Distribution
|
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
a687810 to
2ab2787
Compare
888f66c to
6d7891c
Compare
Migrate the app-team-managed child building blocks in the aks, azure-vm and ske
starterkits from the deprecated meshstack_building_block_v2 to meshstack_building_block.
- Convert per-type inputs (value_string/value_int/value_bool/...) to the unified
value = jsonencode(...) shape; CODE inputs are double-encoded per the terraform
runner contract (jsonencode(jsonencode({...}))).
- Read status.outputs via jsondecode(...value).
- Add moved{} blocks so the live blocks migrate in place (no destroy/recreate).
- Bump the meshstack provider constraint to >= 0.23.0 and regenerate READMEs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Switch every e2e smoke-test building block from meshstack_building_block_v2 to
meshstack_building_block, converting inputs to value = jsonencode(...) / sensitive
blocks and rewriting the .tftest.hcl assertions to read outputs via jsondecode(...value)
(CODE/JSON outputs decode twice). No moved{} blocks — e2e runs in ephemeral test state.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…put shape Update the e2e-test skill to use meshstack_building_block, the value = jsonencode(...) / sensitive input shape, and jsondecode(...value) output reads. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Under v2, `value_string = os == "Linux" ? key : null` omitted the input when null. Migrated verbatim to v3, `value = jsonencode(... : null)` instead resolves to the string "null" and the provider marshals that to an explicit JSON null, sending it to the backend. Build inputs via merge() so ssh_public_key / admin_password are only present for the matching OS, restoring the omit-on-null behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
main's endpoint-probe data source (added after this branch was cut) referenced meshstack_building_block_v2.this; the e2e resource is now meshstack_building_block.this. Point the probe at the v3 resource and jsondecode the output value. Surfaced when rebasing the migration onto current main. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6d7891c to
c4c225b
Compare
What
Migrate the hub off the deprecated
meshstack_building_block_v2resource ontomeshstack_building_block.Why
meshstack_building_blockis the recommended resource: it updates inputs, display name and thedefinition version in place (PUT + trigger-run) instead of the
meshstack_building_block_v2destroy-and-recreate, and unifies inputs under a single
value = jsonencode(...).Changes
aks,azure-virtual-machine,ske): child blocks migratedwith
moved {}blocks so live blocks move in place — no destroy/recreate. Verifiedend-to-end against a live SKE Starterkit instance: the git-repository + forgejo-connector child
blocks migrated with
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.moved {}(ephemeral test state).>= 0.23.0on touched modules; READMEs regenerated;e2e-testskill updated to match.
Deferred:
aws/agentic-coding-sandboxThis module uses
meshstack_buildingblock(v1) +meshstack_tenant(v1). Migrating its childblocks to
meshstack_building_blockis entangled with ameshstack_tenant→meshstack_tenant_v4upgrade (v3
target_refneeds the tenantuuid/ref), and nomoved {}can bridge twodifferent resource types — so that path is an unavoidable destroy/recreate of the sandbox tenant
and its cloud resources. This module is therefore left unchanged in this PR and will be migrated
separately once
meshstack_tenant_v4is GA with a proper tenant migration path. This keeps thepresent PR fully non-breaking.
Migration rules applied
value_<type> = X→value = jsonencode(X); sensitive →sensitive = { secret_value = X }.jsonencode(jsonencode({...}))) per the terraform-runner contract..value_<type>→jsondecode(...value)(CODE/JSON outputs decode twice).merge()rather thanvalue = jsonencode(cond ? x : null)— the latter sends an explicit JSONnull, whereas v2'svalue_string = nullomitted the input. Applied toazure-virtual-machine's OS-specificssh_public_key/admin_password.Validation
nix developto match CI's pinnedterraform-docs): Terraform docs / fmt / Validate modules / trailing-whitespace.
tofu testneeds a live meshStack + published provider, so it is left to CI / the smoke-test runner.🤖 Generated with Claude Code